<cfprocessingdirective pageEncoding="utf-8" />
	<cfscript>
	post = event.getValue('post');
	categoryList = event.getValue( 'Category.list' );
	categories = "";
	iterator = post.getCategories().iterator();
	
	validator = event.getValue('post.validator', structNew() );
	action = event.linkTo( event.getValue('action') );
	
	while( iterator.hasNext() ){
	
		categories = listAppend( categories, iterator.next().getIdCategory(), "," );
	
	}
	</cfscript>
	
	<cfoutput>
	
	<br />
    <div class="standardForm">	
	
	<div id="tabs">	
		<ul>
	        <li><a href="##tabs-1">Content</a></li>
	        <li><a href="##tabs-2">Categories</a></li>
	        <li><a href="##tabs-3">Publishing</a></li>
	    </ul>
                    
        <form action="#action#" method="post">
					
			<div id="tabs-1">
			
				<fieldset>
		        	<legend>Post</legend>
	                    
					<input type="hidden" id="Idpost" name="Idpost" value="#post.getIdpost()#" />
				
		            <label for="Title">Title</label>
					<input type="text" class="formBig" id="Title" name="Title" value="#post.getTitle()#" />
					<cfif structKeyExists( validator, 'Title' ) >
					<span class="formError">#validator['Title'][1]#</span>
					</cfif>
					
					<label for="Excerpt">Excerpt</label>
					<cfif structKeyExists( validator, 'Excerpt' ) >
					<span class="formError">#validator['Excerpt'][1]#</span>
					</cfif>
		
					<textarea name="Excerpt"  id="Excerpt" rows="5" cols="80" style="width: 80%" class="textarea">#post.getExcerpt()#</textarea>
					
					<br />
						
		            <label for="Maincontent">Main content</label>
					<cfif structKeyExists( validator, 'Maincontent' ) >
					<span class="formError">#validator['Maincontent'][1]#</span>
					</cfif>
					
					<textarea id="Maincontent" name="Maincontent" rows="15" cols="80" style="width: 80%" class="textarea">#post.getMaincontent()#</textarea>
					
					<br />
					
					
					<cfif not len( post.getUrlsafe() )>
		            <label for="Urlsafe">Url safe</label>
					</cfif>
					
					<input type="#IIF( len( post.getUrlsafe() ) eq 0, DE("text"), DE("hidden") )#" class="formBig" id="Urlsafe" name="Urlsafe" value="#post.getUrlsafe()#" />
					
				</fieldset>
				
	            <br />
				
				</div>
				<div id="tabs-2">
				
					<div>
						<cfset iterator = categoryList.iterator() />
						<fieldset>
			                <legend>Categories:</legend>
							<cfloop condition="#iterator.hasNext()#">
							<cfset next = iterator.next() />
			                <label for="#next.getUuid()#"><input name="category" <cfif listFindNoCase( categories, next.getIdCategory(), "," )>checked="checked"</cfif> id="#next.getUuid()#" value="#next.getIdCategory()#" type="checkbox" />#next.getName()#</label>
							</cfloop>
			            </fieldset>
		
			        </div>
					
	            </div>
				<div id="tabs-3">
				
					<div>
					
						<fieldset>
			            	<legend>Status:</legend>
								<label for="Status1"><input type="radio" id="Status1" name="Status" value="1" <cfif post.getStatus() eq 1>checked="checked"</cfif> />Approved</label>
								<label for="Status0"><input type="radio" id="Status0" name="Status" value="0" <cfif post.getStatus() eq 0>checked="checked"</cfif> />Draft</label>
								
								<cfif structKeyExists( validator, 'Status' ) >
								<span class="formError">#validator['Status'][1]#</span>
								</cfif>
							
								<label for="Publishingdate">Publishing date</label>
								<input type="text" id="Publishingdate" name="Publishingdate" value="#post.getPublishingdate()#" />
								<cfif structKeyExists( validator, 'Publishingdate' ) >
								<span class="formError">#validator['Publishingdate'][1]#</span>
								</cfif>
				
						</fieldset>
						
						<br />
				
						<fieldset>
			            	<legend>Comments:</legend>
							
							<label for="allowComment"><input type="checkbox" id="allowComment" name="allowComment" value="true" <cfif post.getAllowComment()>checked="true"</cfif>/>Allow comment</label>
						
						</fieldset>
		
			        </div>
					
	            </div>
				
				<br />
				
				<div>
	                <input type="submit" value="Submit" class="formButton" />
	            </div>
				
				<br />
				
            </div>
			
			<br />
			
        </form>
		
    </div>
	
	<br/>
    </cfoutput>